{extend name="common/adminBase" /}
{block name="body"}
    <div class="layui-fluid">
              <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                  <div class="layui-card">
                        <div class="layui-card-body ">
                            <form class="layui-form layui-col-space5">
                                <div class="layui-upload">
                                  <button type="button" class="layui-btn" id="test1">上传评分标准</button>
                                  {if $admin.bz}
                                  <button type="button" class="layui-btn" onclick="tanchu('{$admin.bz}')">查看</button>
                                  {/if}
                                  <div class="layui-upload-list">
                                    <img class="layui-upload-img" id="file">
                                    <p id="demoText"></p>
                                  </div>
                                  <div style="width: 95px;">
                                    <div class="layui-progress layui-progress-big" lay-showpercent="yes" lay-filter="demo">
                                      <div class="layui-progress-bar" lay-percent=""></div>
                                    </div>
                                  </div>
                                </div> 
                            </form>
                        </div>
                  </div>  
                </div> 
              </div>
            </div>
    
    <script>
        layui.use(['upload', 'element', 'layer'], function(){
          var $ = layui.jquery
          ,upload = layui.upload
          ,element = layui.element
          ,layer = layui.layer;
          upload.render({
                elem: '#test1'
                ,url: '/index/power/uploadzj' //改成您自己的上传接口
                ,accept: 'file'
                ,'field':'file'
                ,done: function(res){
                  layer.msg('上传成功');
                //   layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.files.file);
                  window.location.href='';
                }
              });
        });
        function tanchu(url){
            layer.open({
              type: 2,
              title: '评分标准',
              shadeClose: true,
              shade: 0.8,
              area: ['700px', '90%'],
              content: 'https://view.officeapps.live.com/op/view.aspx?src='+url //iframe的url
            }); 
        }
    </script>
{/block}